package com.ruoyi.lwpq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lwpq.mapper.LwpqPxMapper;
import com.ruoyi.lwpq.domain.LwpqPx;
import com.ruoyi.lwpq.service.ILwpqPxService;
import com.ruoyi.common.core.text.Convert;

/**
 * 培训Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-16
 */
@Service
public class LwpqPxServiceImpl implements ILwpqPxService 
{
    @Autowired
    private LwpqPxMapper lwpqPxMapper;

    /**
     * 查询培训
     * 
     * @param id 培训主键
     * @return 培训
     */
    @Override
    public LwpqPx selectLwpqPxById(Long id)
    {
        return lwpqPxMapper.selectLwpqPxById(id);
    }

    /**
     * 查询培训列表
     * 
     * @param lwpqPx 培训
     * @return 培训
     */
    @Override
    public List<LwpqPx> selectLwpqPxList(LwpqPx lwpqPx)
    {
        return lwpqPxMapper.selectLwpqPxList(lwpqPx);
    }

    /**
     * 新增培训
     * 
     * @param lwpqPx 培训
     * @return 结果
     */
    @Override
    public int insertLwpqPx(LwpqPx lwpqPx)
    {
        lwpqPx.setCreateTime(DateUtils.getNowDate());
        return lwpqPxMapper.insertLwpqPx(lwpqPx);
    }

    /**
     * 修改培训
     * 
     * @param lwpqPx 培训
     * @return 结果
     */
    @Override
    public int updateLwpqPx(LwpqPx lwpqPx)
    {
        lwpqPx.setUpdateTime(DateUtils.getNowDate());
        return lwpqPxMapper.updateLwpqPx(lwpqPx);
    }

    /**
     * 批量删除培训
     * 
     * @param ids 需要删除的培训主键
     * @return 结果
     */
    @Override
    public int deleteLwpqPxByIds(String ids)
    {
        return lwpqPxMapper.deleteLwpqPxByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除培训信息
     * 
     * @param id 培训主键
     * @return 结果
     */
    @Override
    public int deleteLwpqPxById(Long id)
    {
        return lwpqPxMapper.deleteLwpqPxById(id);
    }
}
